<template>

  <div>
    <a-button type="primary" @click="btnClick">
      编辑
    </a-button>

    <h1>人员id：{{data.user_id}}</h1>
    <h1>姓名：{{data.username}}</h1>
    <h1>年龄：{{data.age}}</h1>
    <h1>Email：{{data.email}}</h1>
    <h1>手机号：{{data.mobile}}</h1>
  </div>

</template>

<script>
export default {
  name: 'profile',
  data() {
    return {
      data: []
    };
  },
  beforeCreate() {

  },
  created() {
     // 数据请求 this.$http.post
          this.data =  {
            user_id: 'Xs12',
            username: '六',
            age: '24',
            email: '12@qq.com',
            mobile: '1530000000',
            key: 1
          }
  },
  methods: {
      btnClick() {
        this.$store.commit('setState', {
          title: '人员编辑'
        });

        this.$router.push({
          name: 'edit',
          params: {
            user_id: this.data.user_id
          }
        })
    },
  },
};
</script>
